<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<!-- 1 1 2 3 5 8 13 21-->

<body>

</body>

<script>
    function getBytes(str) {
        var len = str.length;
        for (let i = 0; i < len; i++) {
            if (str.charCodeAt(i) > 255) {
                len++
            }

        }
        return len;
    }
    console.log(getBytes('henhan哦无任何'));

</script>

</html>